package com.example.game.controller;

import com.example.game.common.Result;
import com.example.game.dao.bo.AdminHarderBO;
import com.example.game.dao.bo.QueryAdminBO;
import com.example.game.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author CHENTAIWEN
 * @create 2023/2/17 8:39
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    /**
     * 获取到角色
     *
     * @param queryAdminBO
     * @return {@link AdminHarderBO}
     */
    @PostMapping("/queryAdmin")
    public Result<AdminHarderBO> queryAdmin(@RequestBody QueryAdminBO queryAdminBO) {
        AdminHarderBO adminHarder = adminService.queryAdmin(queryAdminBO);
        return Result.ok(adminHarder);
    }

    /**
     * 随机获取角色武器
     *
     * @param
     * @return {@link String}
     */
    @PostMapping("/roleArms")
    public Result<String> roleArms() {
        String roleArms = adminService.roleArms();
        return Result.ok(roleArms);
    }
}
